<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="org.edu.system.DBConnect" %>
<%@ page import="java.sql.*" %>
<!DOCTYPE html>
<html>
<head>
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8">
<title>修改课程</title>
</head>
<body>
<br>
<center>
<% 
	request.setCharacterEncoding("utf-8");
%>
<form action="<%=request.getContextPath()%>/updateCourse" method="post">
<table width="80%" style="border-collapse:separate; border-spacing:10px;text-align:left">
	<%
		String adm_id = (String) (session.getAttribute("UserName"));
		request.setCharacterEncoding("utf-8");
		Connection con = DBConnect.getCon();
		Statement stmt = null;
		ResultSet rs = null;
		stmt = con.createStatement();
		String sql = "select * from course where course_id='"+request.getParameter("course_id")+"'";
		rs = stmt.executeQuery(sql);//执行命令
		if(rs.next())
		{
			out.print("<tr>");
			out.print("<td width=\"15%\">课程ID：</td>");
			out.print("<td>"+rs.getString("course_id")+"</td>");
			out.print("</tr>");
	%>
	<tr>
		<td>课程名称：</td>
		<td><input text="text" name="name" value="<%=rs.getString("course_name")%>"/></td>
	</tr>
	<tr>
		<td valign="top">课程简介：</td>
		<td><textarea rows="10" cols="70" name="intro"><%=rs.getString("course_info")%></textarea></td>
	</tr>
	<tr>
		<td valign="top">课程学分：</td>
		<td><input text="text" name="credit" value="<%=rs.getString("course_credit")%>"/></textarea></td>
	</tr>
	<input type="hidden" name="course_id" value="<%=rs.getString("course_id")%>">
	<%
		}
	%>
</table>
	<br>
	<input type="submit" class="btn btn-primary" value="保存修改"/>
	</form>
</center>
</body>
</html>